package Mangos::DB::Mangos::CreatureTemplate;

use strict;

use base qw(Mangos::DB::Mangos);

__PACKAGE__->meta->setup
(
    table   => 'creature_template',

    columns => 
    [
        entry                => { type => 'integer', not_null => 1 },
        difficulty_entry_1   => { type => 'integer', default => '0', not_null => 1 },
        difficulty_entry_2   => { type => 'integer', default => '0', not_null => 1 },
        difficulty_entry_3   => { type => 'integer', default => '0', not_null => 1 },
        KillCredit1          => { type => 'integer', default => '0', not_null => 1 },
        KillCredit2          => { type => 'integer', default => '0', not_null => 1 },
        modelid_A            => { type => 'integer', default => '0', not_null => 1 },
        modelid_A2           => { type => 'integer', default => '0', not_null => 1 },
        modelid_H            => { type => 'integer', default => '0', not_null => 1 },
        modelid_H2           => { type => 'integer', default => '0', not_null => 1 },
        name                 => { type => 'character', default => '0', length => 100, not_null => 1 },
        subname              => { type => 'character', length => 100 },
        IconName             => { type => 'character', length => 100 },
        gossip_menu_id       => { type => 'integer', default => '0', not_null => 1 },
        minlevel             => { type => 'integer', default => 1, not_null => 1 },
        maxlevel             => { type => 'integer', default => 1, not_null => 1 },
        minhealth            => { type => 'integer', default => '0', not_null => 1 },
        maxhealth            => { type => 'integer', default => '0', not_null => 1 },
        minmana              => { type => 'integer', default => '0', not_null => 1 },
        maxmana              => { type => 'integer', default => '0', not_null => 1 },
        armor                => { type => 'integer', default => '0', not_null => 1 },
        faction_A            => { type => 'integer', default => '0', not_null => 1 },
        faction_H            => { type => 'integer', default => '0', not_null => 1 },
        npcflag              => { type => 'integer', default => '0', not_null => 1 },
        speed                => { type => 'float', default => 1, precision => 32 },
        scale                => { type => 'float', default => 1, not_null => 1, precision => 32 },
        rank                 => { type => 'integer', default => '0', not_null => 1 },
        mindmg               => { type => 'float', default => '0', not_null => 1, precision => 32 },
        maxdmg               => { type => 'float', default => '0', not_null => 1, precision => 32 },
        dmgschool            => { type => 'integer', default => '0', not_null => 1 },
        attackpower          => { type => 'integer', default => '0', not_null => 1 },
        dmg_multiplier       => { type => 'float', default => 1, not_null => 1, precision => 32 },
        baseattacktime       => { type => 'integer', default => '0', not_null => 1 },
        rangeattacktime      => { type => 'integer', default => '0', not_null => 1 },
        unit_class           => { type => 'integer', default => '0', not_null => 1 },
        unit_flags           => { type => 'integer', default => '0', not_null => 1 },
        dynamicflags         => { type => 'integer', default => '0', not_null => 1 },
        family               => { type => 'integer', default => '0', not_null => 1 },
        trainer_type         => { type => 'integer', default => '0', not_null => 1 },
        trainer_spell        => { type => 'integer', default => '0', not_null => 1 },
        trainer_class        => { type => 'integer', default => '0', not_null => 1 },
        trainer_race         => { type => 'integer', default => '0', not_null => 1 },
        minrangedmg          => { type => 'float', default => '0', not_null => 1, precision => 32 },
        maxrangedmg          => { type => 'float', default => '0', not_null => 1, precision => 32 },
        rangedattackpower    => { type => 'integer', default => '0', not_null => 1 },
        type                 => { type => 'integer', default => '0', not_null => 1 },
        type_flags           => { type => 'integer', default => '0', not_null => 1 },
        lootid               => { type => 'integer', default => '0', not_null => 1 },
        pickpocketloot       => { type => 'integer', default => '0', not_null => 1 },
        skinloot             => { type => 'integer', default => '0', not_null => 1 },
        resistance1          => { type => 'integer', default => '0', not_null => 1 },
        resistance2          => { type => 'integer', default => '0', not_null => 1 },
        resistance3          => { type => 'integer', default => '0', not_null => 1 },
        resistance4          => { type => 'integer', default => '0', not_null => 1 },
        resistance5          => { type => 'integer', default => '0', not_null => 1 },
        resistance6          => { type => 'integer', default => '0', not_null => 1 },
        spell1               => { type => 'integer', default => '0', not_null => 1 },
        spell2               => { type => 'integer', default => '0', not_null => 1 },
        spell3               => { type => 'integer', default => '0', not_null => 1 },
        spell4               => { type => 'integer', default => '0', not_null => 1 },
        PetSpellDataId       => { type => 'integer', default => '0', not_null => 1 },
        mingold              => { type => 'integer', default => '0', not_null => 1 },
        maxgold              => { type => 'integer', default => '0', not_null => 1 },
        AIName               => { type => 'character', default => '', length => 64, not_null => 1 },
        MovementType         => { type => 'integer', default => '0', not_null => 1 },
        InhabitType          => { type => 'integer', default => 3, not_null => 1 },
        unk16                => { type => 'float', default => 1, not_null => 1, precision => 32 },
        unk17                => { type => 'float', default => 1, not_null => 1, precision => 32 },
        RacialLeader         => { type => 'integer', default => '0', not_null => 1 },
        questItem1           => { type => 'integer', default => '0', not_null => 1 },
        questItem2           => { type => 'integer', default => '0', not_null => 1 },
        questItem3           => { type => 'integer', default => '0', not_null => 1 },
        questItem4           => { type => 'integer', default => '0', not_null => 1 },
        questItem5           => { type => 'integer', default => '0', not_null => 1 },
        questItem6           => { type => 'integer', default => '0', not_null => 1 },
        movementId           => { type => 'integer', default => '0', not_null => 1 },
        RegenHealth          => { type => 'integer', default => 1, not_null => 1 },
        equipment_id         => { type => 'integer', default => '0', not_null => 1 },
        mechanic_immune_mask => { type => 'integer', default => '0', not_null => 1 },
        flags_extra          => { type => 'integer', default => '0', not_null => 1 },
        ScriptName           => { type => 'character', default => '', length => 64, not_null => 1 },
    ],

    primary_key_columns => [ 'entry' ],
);

1;

package Mangos::DB::Mangos::CreatureTemplate::Manager;

use strict;
use warnings;

use base 'Rose::DB::Object::Manager';

sub object_class { 'Mangos::DB::Mangos::CreatureTemplate' }

__PACKAGE__->make_manager_methods('creature_template');

1;
